
-- --------------------------------------------------
-- Entity Designer DDL Script for SQL Server 2005, 2008, and Azure
-- --------------------------------------------------
-- Date Created: 01/26/2011 19:28:54
-- Generated from EDMX file: D:\Progetti\CodePlex\SmartHotelFoundation\Sources\SmartHotel.Data\SmartHotelModel.edmx
-- --------------------------------------------------

SET QUOTED_IDENTIFIER OFF;
GO
USE [SmartHotel];
GO
IF SCHEMA_ID(N'dbo') IS NULL EXECUTE(N'CREATE SCHEMA [dbo]');
GO

-- --------------------------------------------------
-- Dropping existing FOREIGN KEY constraints
-- --------------------------------------------------


-- --------------------------------------------------
-- Dropping existing tables
-- --------------------------------------------------


-- --------------------------------------------------
-- Creating all tables
-- --------------------------------------------------

-- Creating table 'Guests'
CREATE TABLE [dbo].[Guests] (
    [GuestId] int IDENTITY(1,1) NOT NULL,
    [Surname] nvarchar(256)  NOT NULL,
    [Name] nvarchar(256)  NOT NULL,
    [DateOfBirth] datetime  NOT NULL,
    [CF] nvarchar(16)  NOT NULL,
    [PI] nvarchar(20)  NULL,
    [ForeignCity] nvarchar(256)  NULL,
    [Notes] nvarchar(max)  NULL,
    [Mail] nvarchar(256)  NULL,
    [BirthCountryId] int  NOT NULL,
    [GenderId] int  NOT NULL,
    [PhoneNumber] nvarchar(20)  NULL,
    [CompanyId] int  NOT NULL,
    [BirthCityId] int  NOT NULL
);
GO

-- Creating table 'Companies'
CREATE TABLE [dbo].[Companies] (
    [CompanyId] int IDENTITY(1,1) NOT NULL,
    [CompanyTypeId] int  NOT NULL,
    [Name] nvarchar(256)  NOT NULL,
    [CF] nvarchar(16)  NOT NULL,
    [PI] nvarchar(max)  NOT NULL,
    [Address] nvarchar(1000)  NOT NULL,
    [CountryId] int  NOT NULL
);
GO

-- Creating table 'Rooms'
CREATE TABLE [dbo].[Rooms] (
    [RoomId] int IDENTITY(1,1) NOT NULL,
    [Number] nvarchar(10)  NOT NULL,
    [Floor] nvarchar(10)  NOT NULL,
    [RoomClassId] int  NOT NULL,
    [RoomTypeId] int  NOT NULL
);
GO

-- Creating table 'Stays'
CREATE TABLE [dbo].[Stays] (
    [StayId] int IDENTITY(1,1) NOT NULL,
    [RoomId] int  NOT NULL,
    [StartDate] datetime  NOT NULL,
    [EndDate] datetime  NOT NULL,
    [Notes] nvarchar(1000)  NULL,
    [ServiceTypeId] int  NOT NULL
);
GO

-- Creating table 'Identifications'
CREATE TABLE [dbo].[Identifications] (
    [IdentificationId] int IDENTITY(1,1) NOT NULL,
    [GuestId] int  NOT NULL,
    [IdentificationTypeId] int  NOT NULL,
    [Number] nvarchar(30)  NOT NULL,
    [DateOfIssue] datetime  NOT NULL,
    [DateOfExpiry] nvarchar(max)  NOT NULL,
    [Authority] nvarchar(1000)  NOT NULL,
    [CountryId] int  NOT NULL
);
GO

-- Creating table 'IdentificationTypes'
CREATE TABLE [dbo].[IdentificationTypes] (
    [IdentificationTypeId] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(256)  NOT NULL
);
GO

-- Creating table 'Suppliers'
CREATE TABLE [dbo].[Suppliers] (
    [SupplierId] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(256)  NOT NULL,
    [PhoneNumberWork] nvarchar(20)  NULL,
    [FAX] nvarchar(20)  NULL,
    [IBAN] nvarchar(40)  NULL,
    [Notes] nvarchar(max)  NULL,
    [PhoneNumberMobile] nvarchar(20)  NULL,
    [PhoneNumberHome] nvarchar(20)  NULL,
    [CF] nvarchar(16)  NULL,
    [PI] nvarchar(20)  NULL
);
GO

-- Creating table 'Receipts'
CREATE TABLE [dbo].[Receipts] (
    [ReceiptId] int IDENTITY(1,1) NOT NULL,
    [ReceiptTypeId] int  NOT NULL,
    [Number] int  NOT NULL,
    [Date] datetime  NOT NULL,
    [PaymentTypeId] int  NOT NULL,
    [PaymentNumber] nvarchar(50)  NULL,
    [Notes] nvarchar(max)  NOT NULL,
    [TotalVat] decimal(18,0)  NOT NULL,
    [TotalNet] decimal(18,0)  NOT NULL,
    [Total] decimal(18,0)  NOT NULL
);
GO

-- Creating table 'CompanyTypes'
CREATE TABLE [dbo].[CompanyTypes] (
    [CompanyTypeId] int IDENTITY(1,1) NOT NULL,
    [Acronym] nvarchar(10)  NOT NULL,
    [Description] nvarchar(256)  NOT NULL
);
GO

-- Creating table 'Countries'
CREATE TABLE [dbo].[Countries] (
    [CountryId] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(256)  NOT NULL,
    [InternationalCode] nvarchar(10)  NOT NULL
);
GO

-- Creating table 'Genders'
CREATE TABLE [dbo].[Genders] (
    [GenderId] int IDENTITY(1,1) NOT NULL,
    [GenderCode] nvarchar(1)  NOT NULL
);
GO

-- Creating table 'RoomClasses'
CREATE TABLE [dbo].[RoomClasses] (
    [RoomClassId] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(256)  NOT NULL,
    [Description] nvarchar(1000)  NOT NULL,
    [PriceForGuest] bit  NOT NULL
);
GO

-- Creating table 'Seasons'
CREATE TABLE [dbo].[Seasons] (
    [SeasonId] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(256)  NOT NULL,
    [StartDate] datetime  NOT NULL,
    [EndDate] datetime  NOT NULL
);
GO

-- Creating table 'RoomClassPrices'
CREATE TABLE [dbo].[RoomClassPrices] (
    [RoomClassId] int  NOT NULL,
    [SeasonId] int  NOT NULL,
    [Price] decimal(18,0)  NOT NULL,
    [StartDate] datetime  NOT NULL
);
GO

-- Creating table 'AgeDiscounts'
CREATE TABLE [dbo].[AgeDiscounts] (
    [AgeDiscountId] int IDENTITY(1,1) NOT NULL,
    [StartAge] int  NOT NULL,
    [EndAge] int  NOT NULL,
    [DiscountRate] decimal(18,0)  NOT NULL,
    [Name] nvarchar(256)  NOT NULL,
    [Description] nvarchar(1000)  NOT NULL
);
GO

-- Creating table 'ReceiptTypes'
CREATE TABLE [dbo].[ReceiptTypes] (
    [ReceiptTypeId] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(256)  NOT NULL,
    [Code] nvarchar(2)  NOT NULL
);
GO

-- Creating table 'GuestStaySet'
CREATE TABLE [dbo].[GuestStaySet] (
    [GuestId] int  NOT NULL,
    [StayStayId] int  NOT NULL,
    [IdentificationId] int  NOT NULL,
    [ProgressiveNumber] int  NOT NULL
);
GO

-- Creating table 'Products'
CREATE TABLE [dbo].[Products] (
    [ProductId] int IDENTITY(1,1) NOT NULL,
    [ProductCategoryId] int  NOT NULL,
    [VatId] int  NOT NULL,
    [ProductCode] nvarchar(50)  NOT NULL,
    [Price] decimal(18,0)  NOT NULL,
    [VatIncluded] bit  NOT NULL,
    [UnitOfMeasurementUnitOfMeasurementId] int  NOT NULL,
    [IsEnabled] bit  NOT NULL
);
GO

-- Creating table 'ProductCategories'
CREATE TABLE [dbo].[ProductCategories] (
    [ProductCategoryId] int IDENTITY(1,1) NOT NULL,
    [ParentProductCategoryId] int  NOT NULL,
    [Name] nvarchar(256)  NOT NULL,
    [Description] nvarchar(1000)  NOT NULL,
    [DefaultVatId] int  NOT NULL,
    [Icon] varbinary(max)  NOT NULL
);
GO

-- Creating table 'VatSet'
CREATE TABLE [dbo].[VatSet] (
    [VatId] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(20)  NOT NULL,
    [Value] decimal(18,0)  NOT NULL,
    [IsEnabled] bit  NOT NULL
);
GO

-- Creating table 'StayExpenses'
CREATE TABLE [dbo].[StayExpenses] (
    [StayExpenseId] int IDENTITY(1,1) NOT NULL,
    [StayId] int  NOT NULL,
    [ProductId] int  NOT NULL,
    [Quantity] decimal(18,0)  NOT NULL,
    [Date] datetime  NOT NULL,
    [ReceiptExpense_ReceiptExpenseId] int  NOT NULL
);
GO

-- Creating table 'Districts'
CREATE TABLE [dbo].[Districts] (
    [DistrictId] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(max)  NOT NULL,
    [CountryId] int  NOT NULL
);
GO

-- Creating table 'Cities'
CREATE TABLE [dbo].[Cities] (
    [CityId] int IDENTITY(1,1) NOT NULL,
    [DistrictId] int  NOT NULL,
    [FinanceCode] nvarchar(5)  NOT NULL,
    [Name] nvarchar(max)  NOT NULL
);
GO

-- Creating table 'ServiceTypes'
CREATE TABLE [dbo].[ServiceTypes] (
    [ServiceTypeId] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(256)  NOT NULL,
    [Description] nvarchar(1000)  NOT NULL
);
GO

-- Creating table 'ServiceTypePrices'
CREATE TABLE [dbo].[ServiceTypePrices] (
    [SeasonId] int  NOT NULL,
    [ServiceTypeId] int  NOT NULL,
    [Price] decimal(18,0)  NOT NULL,
    [StartDate] nvarchar(max)  NOT NULL
);
GO

-- Creating table 'PaymentTypes'
CREATE TABLE [dbo].[PaymentTypes] (
    [PaymentTypeId] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(max)  NOT NULL,
    [NeedPaymentNumber] bit  NOT NULL
);
GO

-- Creating table 'ReceiptExpenses'
CREATE TABLE [dbo].[ReceiptExpenses] (
    [ReceiptExpenseId] int IDENTITY(1,1) NOT NULL,
    [Quantity] decimal(18,0)  NOT NULL,
    [Date] datetime  NOT NULL,
    [ReceiptId] int  NOT NULL,
    [ProductId] int  NOT NULL,
    [Discount] decimal(18,0)  NOT NULL,
    [TotalExpense] decimal(18,0)  NOT NULL
);
GO

-- Creating table 'UnitOfMeasurementSet'
CREATE TABLE [dbo].[UnitOfMeasurementSet] (
    [UnitOfMeasurementId] int IDENTITY(1,1) NOT NULL,
    [ShortName] nvarchar(5)  NOT NULL,
    [LongName] nvarchar(256)  NOT NULL
);
GO

-- Creating table 'RoomTypes'
CREATE TABLE [dbo].[RoomTypes] (
    [RoomTypeId] int IDENTITY(1,1) NOT NULL,
    [MaxDefaultGuests] int  NOT NULL,
    [IsConferenceRoom] bit  NOT NULL,
    [Bath] bit  NOT NULL,
    [Shower] bit  NOT NULL,
    [TV] bit  NOT NULL,
    [MaxExtraGuests] int  NOT NULL
);
GO

-- Creating table 'SubtotalPerVats'
CREATE TABLE [dbo].[SubtotalPerVats] (
    [ReceiptId] int  NOT NULL,
    [VatId] int  NOT NULL,
    [TotalVat] decimal(18,0)  NOT NULL,
    [TotalNet] decimal(18,0)  NOT NULL,
    [Total] decimal(18,0)  NOT NULL
);
GO

-- Creating table 'ReceiptStay'
CREATE TABLE [dbo].[ReceiptStay] (
    [Receipts_ReceiptId] int  NOT NULL,
    [Stays_StayId] int  NOT NULL
);
GO

-- Creating table 'RoomClassPriceAgeDiscount'
CREATE TABLE [dbo].[RoomClassPriceAgeDiscount] (
    [RoomClassPrices_RoomClassId] int  NOT NULL,
    [RoomClassPrices_SeasonId] int  NOT NULL,
    [AgeDiscounts_AgeDiscountId] int  NOT NULL
);
GO

-- Creating table 'GuestReceipt'
CREATE TABLE [dbo].[GuestReceipt] (
    [Guests_GuestId] int  NOT NULL,
    [Receipts_ReceiptId] int  NOT NULL
);
GO

-- Creating table 'ServiceTypePriceAgeDiscount'
CREATE TABLE [dbo].[ServiceTypePriceAgeDiscount] (
    [ServiceTypePrices_ServiceTypeId] int  NOT NULL,
    [ServiceTypePrices_SeasonId] int  NOT NULL,
    [AgeDiscounts_AgeDiscountId] int  NOT NULL
);
GO

-- --------------------------------------------------
-- Creating all PRIMARY KEY constraints
-- --------------------------------------------------

-- Creating primary key on [GuestId] in table 'Guests'
ALTER TABLE [dbo].[Guests]
ADD CONSTRAINT [PK_Guests]
    PRIMARY KEY CLUSTERED ([GuestId] ASC);
GO

-- Creating primary key on [CompanyId] in table 'Companies'
ALTER TABLE [dbo].[Companies]
ADD CONSTRAINT [PK_Companies]
    PRIMARY KEY CLUSTERED ([CompanyId] ASC);
GO

-- Creating primary key on [RoomId] in table 'Rooms'
ALTER TABLE [dbo].[Rooms]
ADD CONSTRAINT [PK_Rooms]
    PRIMARY KEY CLUSTERED ([RoomId] ASC);
GO

-- Creating primary key on [StayId] in table 'Stays'
ALTER TABLE [dbo].[Stays]
ADD CONSTRAINT [PK_Stays]
    PRIMARY KEY CLUSTERED ([StayId] ASC);
GO

-- Creating primary key on [IdentificationId] in table 'Identifications'
ALTER TABLE [dbo].[Identifications]
ADD CONSTRAINT [PK_Identifications]
    PRIMARY KEY CLUSTERED ([IdentificationId] ASC);
GO

-- Creating primary key on [IdentificationTypeId] in table 'IdentificationTypes'
ALTER TABLE [dbo].[IdentificationTypes]
ADD CONSTRAINT [PK_IdentificationTypes]
    PRIMARY KEY CLUSTERED ([IdentificationTypeId] ASC);
GO

-- Creating primary key on [SupplierId] in table 'Suppliers'
ALTER TABLE [dbo].[Suppliers]
ADD CONSTRAINT [PK_Suppliers]
    PRIMARY KEY CLUSTERED ([SupplierId] ASC);
GO

-- Creating primary key on [ReceiptId] in table 'Receipts'
ALTER TABLE [dbo].[Receipts]
ADD CONSTRAINT [PK_Receipts]
    PRIMARY KEY CLUSTERED ([ReceiptId] ASC);
GO

-- Creating primary key on [CompanyTypeId] in table 'CompanyTypes'
ALTER TABLE [dbo].[CompanyTypes]
ADD CONSTRAINT [PK_CompanyTypes]
    PRIMARY KEY CLUSTERED ([CompanyTypeId] ASC);
GO

-- Creating primary key on [CountryId] in table 'Countries'
ALTER TABLE [dbo].[Countries]
ADD CONSTRAINT [PK_Countries]
    PRIMARY KEY CLUSTERED ([CountryId] ASC);
GO

-- Creating primary key on [GenderId] in table 'Genders'
ALTER TABLE [dbo].[Genders]
ADD CONSTRAINT [PK_Genders]
    PRIMARY KEY CLUSTERED ([GenderId] ASC);
GO

-- Creating primary key on [RoomClassId] in table 'RoomClasses'
ALTER TABLE [dbo].[RoomClasses]
ADD CONSTRAINT [PK_RoomClasses]
    PRIMARY KEY CLUSTERED ([RoomClassId] ASC);
GO

-- Creating primary key on [SeasonId] in table 'Seasons'
ALTER TABLE [dbo].[Seasons]
ADD CONSTRAINT [PK_Seasons]
    PRIMARY KEY CLUSTERED ([SeasonId] ASC);
GO

-- Creating primary key on [RoomClassId], [SeasonId] in table 'RoomClassPrices'
ALTER TABLE [dbo].[RoomClassPrices]
ADD CONSTRAINT [PK_RoomClassPrices]
    PRIMARY KEY CLUSTERED ([RoomClassId], [SeasonId] ASC);
GO

-- Creating primary key on [AgeDiscountId] in table 'AgeDiscounts'
ALTER TABLE [dbo].[AgeDiscounts]
ADD CONSTRAINT [PK_AgeDiscounts]
    PRIMARY KEY CLUSTERED ([AgeDiscountId] ASC);
GO

-- Creating primary key on [ReceiptTypeId] in table 'ReceiptTypes'
ALTER TABLE [dbo].[ReceiptTypes]
ADD CONSTRAINT [PK_ReceiptTypes]
    PRIMARY KEY CLUSTERED ([ReceiptTypeId] ASC);
GO

-- Creating primary key on [GuestId], [StayStayId] in table 'GuestStaySet'
ALTER TABLE [dbo].[GuestStaySet]
ADD CONSTRAINT [PK_GuestStaySet]
    PRIMARY KEY CLUSTERED ([GuestId], [StayStayId] ASC);
GO

-- Creating primary key on [ProductId] in table 'Products'
ALTER TABLE [dbo].[Products]
ADD CONSTRAINT [PK_Products]
    PRIMARY KEY CLUSTERED ([ProductId] ASC);
GO

-- Creating primary key on [ProductCategoryId] in table 'ProductCategories'
ALTER TABLE [dbo].[ProductCategories]
ADD CONSTRAINT [PK_ProductCategories]
    PRIMARY KEY CLUSTERED ([ProductCategoryId] ASC);
GO

-- Creating primary key on [VatId] in table 'VatSet'
ALTER TABLE [dbo].[VatSet]
ADD CONSTRAINT [PK_VatSet]
    PRIMARY KEY CLUSTERED ([VatId] ASC);
GO

-- Creating primary key on [StayExpenseId] in table 'StayExpenses'
ALTER TABLE [dbo].[StayExpenses]
ADD CONSTRAINT [PK_StayExpenses]
    PRIMARY KEY CLUSTERED ([StayExpenseId] ASC);
GO

-- Creating primary key on [DistrictId] in table 'Districts'
ALTER TABLE [dbo].[Districts]
ADD CONSTRAINT [PK_Districts]
    PRIMARY KEY CLUSTERED ([DistrictId] ASC);
GO

-- Creating primary key on [CityId] in table 'Cities'
ALTER TABLE [dbo].[Cities]
ADD CONSTRAINT [PK_Cities]
    PRIMARY KEY CLUSTERED ([CityId] ASC);
GO

-- Creating primary key on [ServiceTypeId] in table 'ServiceTypes'
ALTER TABLE [dbo].[ServiceTypes]
ADD CONSTRAINT [PK_ServiceTypes]
    PRIMARY KEY CLUSTERED ([ServiceTypeId] ASC);
GO

-- Creating primary key on [ServiceTypeId], [SeasonId] in table 'ServiceTypePrices'
ALTER TABLE [dbo].[ServiceTypePrices]
ADD CONSTRAINT [PK_ServiceTypePrices]
    PRIMARY KEY CLUSTERED ([ServiceTypeId], [SeasonId] ASC);
GO

-- Creating primary key on [PaymentTypeId] in table 'PaymentTypes'
ALTER TABLE [dbo].[PaymentTypes]
ADD CONSTRAINT [PK_PaymentTypes]
    PRIMARY KEY CLUSTERED ([PaymentTypeId] ASC);
GO

-- Creating primary key on [ReceiptExpenseId] in table 'ReceiptExpenses'
ALTER TABLE [dbo].[ReceiptExpenses]
ADD CONSTRAINT [PK_ReceiptExpenses]
    PRIMARY KEY CLUSTERED ([ReceiptExpenseId] ASC);
GO

-- Creating primary key on [UnitOfMeasurementId] in table 'UnitOfMeasurementSet'
ALTER TABLE [dbo].[UnitOfMeasurementSet]
ADD CONSTRAINT [PK_UnitOfMeasurementSet]
    PRIMARY KEY CLUSTERED ([UnitOfMeasurementId] ASC);
GO

-- Creating primary key on [RoomTypeId] in table 'RoomTypes'
ALTER TABLE [dbo].[RoomTypes]
ADD CONSTRAINT [PK_RoomTypes]
    PRIMARY KEY CLUSTERED ([RoomTypeId] ASC);
GO

-- Creating primary key on [ReceiptId], [VatId] in table 'SubtotalPerVats'
ALTER TABLE [dbo].[SubtotalPerVats]
ADD CONSTRAINT [PK_SubtotalPerVats]
    PRIMARY KEY CLUSTERED ([ReceiptId], [VatId] ASC);
GO

-- Creating primary key on [Receipts_ReceiptId], [Stays_StayId] in table 'ReceiptStay'
ALTER TABLE [dbo].[ReceiptStay]
ADD CONSTRAINT [PK_ReceiptStay]
    PRIMARY KEY NONCLUSTERED ([Receipts_ReceiptId], [Stays_StayId] ASC);
GO

-- Creating primary key on [RoomClassPrices_RoomClassId], [RoomClassPrices_SeasonId], [AgeDiscounts_AgeDiscountId] in table 'RoomClassPriceAgeDiscount'
ALTER TABLE [dbo].[RoomClassPriceAgeDiscount]
ADD CONSTRAINT [PK_RoomClassPriceAgeDiscount]
    PRIMARY KEY NONCLUSTERED ([RoomClassPrices_RoomClassId], [RoomClassPrices_SeasonId], [AgeDiscounts_AgeDiscountId] ASC);
GO

-- Creating primary key on [Guests_GuestId], [Receipts_ReceiptId] in table 'GuestReceipt'
ALTER TABLE [dbo].[GuestReceipt]
ADD CONSTRAINT [PK_GuestReceipt]
    PRIMARY KEY NONCLUSTERED ([Guests_GuestId], [Receipts_ReceiptId] ASC);
GO

-- Creating primary key on [ServiceTypePrices_ServiceTypeId], [ServiceTypePrices_SeasonId], [AgeDiscounts_AgeDiscountId] in table 'ServiceTypePriceAgeDiscount'
ALTER TABLE [dbo].[ServiceTypePriceAgeDiscount]
ADD CONSTRAINT [PK_ServiceTypePriceAgeDiscount]
    PRIMARY KEY NONCLUSTERED ([ServiceTypePrices_ServiceTypeId], [ServiceTypePrices_SeasonId], [AgeDiscounts_AgeDiscountId] ASC);
GO

-- --------------------------------------------------
-- Creating all FOREIGN KEY constraints
-- --------------------------------------------------

-- Creating foreign key on [RoomId] in table 'Stays'
ALTER TABLE [dbo].[Stays]
ADD CONSTRAINT [FK_RoomStay]
    FOREIGN KEY ([RoomId])
    REFERENCES [dbo].[Rooms]
        ([RoomId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_RoomStay'
CREATE INDEX [IX_FK_RoomStay]
ON [dbo].[Stays]
    ([RoomId]);
GO

-- Creating foreign key on [GuestId] in table 'Identifications'
ALTER TABLE [dbo].[Identifications]
ADD CONSTRAINT [FK_GuestIdentification]
    FOREIGN KEY ([GuestId])
    REFERENCES [dbo].[Guests]
        ([GuestId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_GuestIdentification'
CREATE INDEX [IX_FK_GuestIdentification]
ON [dbo].[Identifications]
    ([GuestId]);
GO

-- Creating foreign key on [IdentificationTypeId] in table 'Identifications'
ALTER TABLE [dbo].[Identifications]
ADD CONSTRAINT [FK_IdentificationTypeIdentification]
    FOREIGN KEY ([IdentificationTypeId])
    REFERENCES [dbo].[IdentificationTypes]
        ([IdentificationTypeId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_IdentificationTypeIdentification'
CREATE INDEX [IX_FK_IdentificationTypeIdentification]
ON [dbo].[Identifications]
    ([IdentificationTypeId]);
GO

-- Creating foreign key on [Receipts_ReceiptId] in table 'ReceiptStay'
ALTER TABLE [dbo].[ReceiptStay]
ADD CONSTRAINT [FK_ReceiptStay_Receipt]
    FOREIGN KEY ([Receipts_ReceiptId])
    REFERENCES [dbo].[Receipts]
        ([ReceiptId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Stays_StayId] in table 'ReceiptStay'
ALTER TABLE [dbo].[ReceiptStay]
ADD CONSTRAINT [FK_ReceiptStay_Stay]
    FOREIGN KEY ([Stays_StayId])
    REFERENCES [dbo].[Stays]
        ([StayId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_ReceiptStay_Stay'
CREATE INDEX [IX_FK_ReceiptStay_Stay]
ON [dbo].[ReceiptStay]
    ([Stays_StayId]);
GO

-- Creating foreign key on [CompanyTypeId] in table 'Companies'
ALTER TABLE [dbo].[Companies]
ADD CONSTRAINT [FK_CompanyTypeCompany]
    FOREIGN KEY ([CompanyTypeId])
    REFERENCES [dbo].[CompanyTypes]
        ([CompanyTypeId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_CompanyTypeCompany'
CREATE INDEX [IX_FK_CompanyTypeCompany]
ON [dbo].[Companies]
    ([CompanyTypeId]);
GO

-- Creating foreign key on [BirthCountryId] in table 'Guests'
ALTER TABLE [dbo].[Guests]
ADD CONSTRAINT [FK_CountryGuest]
    FOREIGN KEY ([BirthCountryId])
    REFERENCES [dbo].[Countries]
        ([CountryId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_CountryGuest'
CREATE INDEX [IX_FK_CountryGuest]
ON [dbo].[Guests]
    ([BirthCountryId]);
GO

-- Creating foreign key on [CountryId] in table 'Companies'
ALTER TABLE [dbo].[Companies]
ADD CONSTRAINT [FK_CountryCompany]
    FOREIGN KEY ([CountryId])
    REFERENCES [dbo].[Countries]
        ([CountryId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_CountryCompany'
CREATE INDEX [IX_FK_CountryCompany]
ON [dbo].[Companies]
    ([CountryId]);
GO

-- Creating foreign key on [CountryId] in table 'Identifications'
ALTER TABLE [dbo].[Identifications]
ADD CONSTRAINT [FK_CountryIdentification]
    FOREIGN KEY ([CountryId])
    REFERENCES [dbo].[Countries]
        ([CountryId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_CountryIdentification'
CREATE INDEX [IX_FK_CountryIdentification]
ON [dbo].[Identifications]
    ([CountryId]);
GO

-- Creating foreign key on [GenderId] in table 'Guests'
ALTER TABLE [dbo].[Guests]
ADD CONSTRAINT [FK_GenderGuest]
    FOREIGN KEY ([GenderId])
    REFERENCES [dbo].[Genders]
        ([GenderId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_GenderGuest'
CREATE INDEX [IX_FK_GenderGuest]
ON [dbo].[Guests]
    ([GenderId]);
GO

-- Creating foreign key on [RoomClassId] in table 'Rooms'
ALTER TABLE [dbo].[Rooms]
ADD CONSTRAINT [FK_RoomClassRoom]
    FOREIGN KEY ([RoomClassId])
    REFERENCES [dbo].[RoomClasses]
        ([RoomClassId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_RoomClassRoom'
CREATE INDEX [IX_FK_RoomClassRoom]
ON [dbo].[Rooms]
    ([RoomClassId]);
GO

-- Creating foreign key on [RoomClassId] in table 'RoomClassPrices'
ALTER TABLE [dbo].[RoomClassPrices]
ADD CONSTRAINT [FK_RoomClassRoomClassPrice]
    FOREIGN KEY ([RoomClassId])
    REFERENCES [dbo].[RoomClasses]
        ([RoomClassId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [SeasonId] in table 'RoomClassPrices'
ALTER TABLE [dbo].[RoomClassPrices]
ADD CONSTRAINT [FK_SeasonRoomClassPrice]
    FOREIGN KEY ([SeasonId])
    REFERENCES [dbo].[Seasons]
        ([SeasonId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_SeasonRoomClassPrice'
CREATE INDEX [IX_FK_SeasonRoomClassPrice]
ON [dbo].[RoomClassPrices]
    ([SeasonId]);
GO

-- Creating foreign key on [RoomClassPrices_RoomClassId], [RoomClassPrices_SeasonId] in table 'RoomClassPriceAgeDiscount'
ALTER TABLE [dbo].[RoomClassPriceAgeDiscount]
ADD CONSTRAINT [FK_RoomClassPriceAgeDiscount_RoomClassPrice]
    FOREIGN KEY ([RoomClassPrices_RoomClassId], [RoomClassPrices_SeasonId])
    REFERENCES [dbo].[RoomClassPrices]
        ([RoomClassId], [SeasonId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [AgeDiscounts_AgeDiscountId] in table 'RoomClassPriceAgeDiscount'
ALTER TABLE [dbo].[RoomClassPriceAgeDiscount]
ADD CONSTRAINT [FK_RoomClassPriceAgeDiscount_AgeDiscount]
    FOREIGN KEY ([AgeDiscounts_AgeDiscountId])
    REFERENCES [dbo].[AgeDiscounts]
        ([AgeDiscountId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_RoomClassPriceAgeDiscount_AgeDiscount'
CREATE INDEX [IX_FK_RoomClassPriceAgeDiscount_AgeDiscount]
ON [dbo].[RoomClassPriceAgeDiscount]
    ([AgeDiscounts_AgeDiscountId]);
GO

-- Creating foreign key on [CompanyId] in table 'Guests'
ALTER TABLE [dbo].[Guests]
ADD CONSTRAINT [FK_CompanyGuest]
    FOREIGN KEY ([CompanyId])
    REFERENCES [dbo].[Companies]
        ([CompanyId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_CompanyGuest'
CREATE INDEX [IX_FK_CompanyGuest]
ON [dbo].[Guests]
    ([CompanyId]);
GO

-- Creating foreign key on [ReceiptTypeId] in table 'Receipts'
ALTER TABLE [dbo].[Receipts]
ADD CONSTRAINT [FK_ReceiptTypeReceipt]
    FOREIGN KEY ([ReceiptTypeId])
    REFERENCES [dbo].[ReceiptTypes]
        ([ReceiptTypeId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_ReceiptTypeReceipt'
CREATE INDEX [IX_FK_ReceiptTypeReceipt]
ON [dbo].[Receipts]
    ([ReceiptTypeId]);
GO

-- Creating foreign key on [GuestId] in table 'GuestStaySet'
ALTER TABLE [dbo].[GuestStaySet]
ADD CONSTRAINT [FK_GuestGuestStay]
    FOREIGN KEY ([GuestId])
    REFERENCES [dbo].[Guests]
        ([GuestId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [StayStayId] in table 'GuestStaySet'
ALTER TABLE [dbo].[GuestStaySet]
ADD CONSTRAINT [FK_StayGuestStay]
    FOREIGN KEY ([StayStayId])
    REFERENCES [dbo].[Stays]
        ([StayId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_StayGuestStay'
CREATE INDEX [IX_FK_StayGuestStay]
ON [dbo].[GuestStaySet]
    ([StayStayId]);
GO

-- Creating foreign key on [IdentificationId] in table 'GuestStaySet'
ALTER TABLE [dbo].[GuestStaySet]
ADD CONSTRAINT [FK_IdentificationGuestStay]
    FOREIGN KEY ([IdentificationId])
    REFERENCES [dbo].[Identifications]
        ([IdentificationId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_IdentificationGuestStay'
CREATE INDEX [IX_FK_IdentificationGuestStay]
ON [dbo].[GuestStaySet]
    ([IdentificationId]);
GO

-- Creating foreign key on [ParentProductCategoryId] in table 'ProductCategories'
ALTER TABLE [dbo].[ProductCategories]
ADD CONSTRAINT [FK_ProductCategoryParentChilds]
    FOREIGN KEY ([ParentProductCategoryId])
    REFERENCES [dbo].[ProductCategories]
        ([ProductCategoryId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_ProductCategoryParentChilds'
CREATE INDEX [IX_FK_ProductCategoryParentChilds]
ON [dbo].[ProductCategories]
    ([ParentProductCategoryId]);
GO

-- Creating foreign key on [ProductCategoryId] in table 'Products'
ALTER TABLE [dbo].[Products]
ADD CONSTRAINT [FK_ProductCategoryProduct]
    FOREIGN KEY ([ProductCategoryId])
    REFERENCES [dbo].[ProductCategories]
        ([ProductCategoryId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_ProductCategoryProduct'
CREATE INDEX [IX_FK_ProductCategoryProduct]
ON [dbo].[Products]
    ([ProductCategoryId]);
GO

-- Creating foreign key on [DefaultVatId] in table 'ProductCategories'
ALTER TABLE [dbo].[ProductCategories]
ADD CONSTRAINT [FK_VatProductCategory]
    FOREIGN KEY ([DefaultVatId])
    REFERENCES [dbo].[VatSet]
        ([VatId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_VatProductCategory'
CREATE INDEX [IX_FK_VatProductCategory]
ON [dbo].[ProductCategories]
    ([DefaultVatId]);
GO

-- Creating foreign key on [VatId] in table 'Products'
ALTER TABLE [dbo].[Products]
ADD CONSTRAINT [FK_VatProduct]
    FOREIGN KEY ([VatId])
    REFERENCES [dbo].[VatSet]
        ([VatId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_VatProduct'
CREATE INDEX [IX_FK_VatProduct]
ON [dbo].[Products]
    ([VatId]);
GO

-- Creating foreign key on [StayId] in table 'StayExpenses'
ALTER TABLE [dbo].[StayExpenses]
ADD CONSTRAINT [FK_StayStayExpense]
    FOREIGN KEY ([StayId])
    REFERENCES [dbo].[Stays]
        ([StayId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_StayStayExpense'
CREATE INDEX [IX_FK_StayStayExpense]
ON [dbo].[StayExpenses]
    ([StayId]);
GO

-- Creating foreign key on [ProductId] in table 'StayExpenses'
ALTER TABLE [dbo].[StayExpenses]
ADD CONSTRAINT [FK_ProductStayExpense]
    FOREIGN KEY ([ProductId])
    REFERENCES [dbo].[Products]
        ([ProductId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_ProductStayExpense'
CREATE INDEX [IX_FK_ProductStayExpense]
ON [dbo].[StayExpenses]
    ([ProductId]);
GO

-- Creating foreign key on [DistrictId] in table 'Cities'
ALTER TABLE [dbo].[Cities]
ADD CONSTRAINT [FK_DistrictCity]
    FOREIGN KEY ([DistrictId])
    REFERENCES [dbo].[Districts]
        ([DistrictId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_DistrictCity'
CREATE INDEX [IX_FK_DistrictCity]
ON [dbo].[Cities]
    ([DistrictId]);
GO

-- Creating foreign key on [CountryId] in table 'Districts'
ALTER TABLE [dbo].[Districts]
ADD CONSTRAINT [FK_CountryDistrict]
    FOREIGN KEY ([CountryId])
    REFERENCES [dbo].[Countries]
        ([CountryId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_CountryDistrict'
CREATE INDEX [IX_FK_CountryDistrict]
ON [dbo].[Districts]
    ([CountryId]);
GO

-- Creating foreign key on [BirthCityId] in table 'Guests'
ALTER TABLE [dbo].[Guests]
ADD CONSTRAINT [FK_CityGuest]
    FOREIGN KEY ([BirthCityId])
    REFERENCES [dbo].[Cities]
        ([CityId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_CityGuest'
CREATE INDEX [IX_FK_CityGuest]
ON [dbo].[Guests]
    ([BirthCityId]);
GO

-- Creating foreign key on [Guests_GuestId] in table 'GuestReceipt'
ALTER TABLE [dbo].[GuestReceipt]
ADD CONSTRAINT [FK_GuestReceipt_Guest]
    FOREIGN KEY ([Guests_GuestId])
    REFERENCES [dbo].[Guests]
        ([GuestId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Receipts_ReceiptId] in table 'GuestReceipt'
ALTER TABLE [dbo].[GuestReceipt]
ADD CONSTRAINT [FK_GuestReceipt_Receipt]
    FOREIGN KEY ([Receipts_ReceiptId])
    REFERENCES [dbo].[Receipts]
        ([ReceiptId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_GuestReceipt_Receipt'
CREATE INDEX [IX_FK_GuestReceipt_Receipt]
ON [dbo].[GuestReceipt]
    ([Receipts_ReceiptId]);
GO

-- Creating foreign key on [ServiceTypeId] in table 'Stays'
ALTER TABLE [dbo].[Stays]
ADD CONSTRAINT [FK_ServiceTypeStay]
    FOREIGN KEY ([ServiceTypeId])
    REFERENCES [dbo].[ServiceTypes]
        ([ServiceTypeId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_ServiceTypeStay'
CREATE INDEX [IX_FK_ServiceTypeStay]
ON [dbo].[Stays]
    ([ServiceTypeId]);
GO

-- Creating foreign key on [SeasonId] in table 'ServiceTypePrices'
ALTER TABLE [dbo].[ServiceTypePrices]
ADD CONSTRAINT [FK_SeasonServiceTypePrice]
    FOREIGN KEY ([SeasonId])
    REFERENCES [dbo].[Seasons]
        ([SeasonId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_SeasonServiceTypePrice'
CREATE INDEX [IX_FK_SeasonServiceTypePrice]
ON [dbo].[ServiceTypePrices]
    ([SeasonId]);
GO

-- Creating foreign key on [PaymentTypeId] in table 'Receipts'
ALTER TABLE [dbo].[Receipts]
ADD CONSTRAINT [FK_PaymentTypeReceipt]
    FOREIGN KEY ([PaymentTypeId])
    REFERENCES [dbo].[PaymentTypes]
        ([PaymentTypeId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_PaymentTypeReceipt'
CREATE INDEX [IX_FK_PaymentTypeReceipt]
ON [dbo].[Receipts]
    ([PaymentTypeId]);
GO

-- Creating foreign key on [ReceiptId] in table 'ReceiptExpenses'
ALTER TABLE [dbo].[ReceiptExpenses]
ADD CONSTRAINT [FK_ReceiptReceiptExpense]
    FOREIGN KEY ([ReceiptId])
    REFERENCES [dbo].[Receipts]
        ([ReceiptId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_ReceiptReceiptExpense'
CREATE INDEX [IX_FK_ReceiptReceiptExpense]
ON [dbo].[ReceiptExpenses]
    ([ReceiptId]);
GO

-- Creating foreign key on [ProductId] in table 'ReceiptExpenses'
ALTER TABLE [dbo].[ReceiptExpenses]
ADD CONSTRAINT [FK_ProductReceiptExpense]
    FOREIGN KEY ([ProductId])
    REFERENCES [dbo].[Products]
        ([ProductId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_ProductReceiptExpense'
CREATE INDEX [IX_FK_ProductReceiptExpense]
ON [dbo].[ReceiptExpenses]
    ([ProductId]);
GO

-- Creating foreign key on [ReceiptExpense_ReceiptExpenseId] in table 'StayExpenses'
ALTER TABLE [dbo].[StayExpenses]
ADD CONSTRAINT [FK_ReceiptExpenseStayExpense]
    FOREIGN KEY ([ReceiptExpense_ReceiptExpenseId])
    REFERENCES [dbo].[ReceiptExpenses]
        ([ReceiptExpenseId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_ReceiptExpenseStayExpense'
CREATE INDEX [IX_FK_ReceiptExpenseStayExpense]
ON [dbo].[StayExpenses]
    ([ReceiptExpense_ReceiptExpenseId]);
GO

-- Creating foreign key on [UnitOfMeasurementUnitOfMeasurementId] in table 'Products'
ALTER TABLE [dbo].[Products]
ADD CONSTRAINT [FK_UnitOfMeasurementProduct]
    FOREIGN KEY ([UnitOfMeasurementUnitOfMeasurementId])
    REFERENCES [dbo].[UnitOfMeasurementSet]
        ([UnitOfMeasurementId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_UnitOfMeasurementProduct'
CREATE INDEX [IX_FK_UnitOfMeasurementProduct]
ON [dbo].[Products]
    ([UnitOfMeasurementUnitOfMeasurementId]);
GO

-- Creating foreign key on [RoomTypeId] in table 'Rooms'
ALTER TABLE [dbo].[Rooms]
ADD CONSTRAINT [FK_RoomTypeRoom]
    FOREIGN KEY ([RoomTypeId])
    REFERENCES [dbo].[RoomTypes]
        ([RoomTypeId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_RoomTypeRoom'
CREATE INDEX [IX_FK_RoomTypeRoom]
ON [dbo].[Rooms]
    ([RoomTypeId]);
GO

-- Creating foreign key on [ReceiptId] in table 'SubtotalPerVats'
ALTER TABLE [dbo].[SubtotalPerVats]
ADD CONSTRAINT [FK_ReceiptSubtotalPerVat]
    FOREIGN KEY ([ReceiptId])
    REFERENCES [dbo].[Receipts]
        ([ReceiptId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [VatId] in table 'SubtotalPerVats'
ALTER TABLE [dbo].[SubtotalPerVats]
ADD CONSTRAINT [FK_VatSubtotalPerVat]
    FOREIGN KEY ([VatId])
    REFERENCES [dbo].[VatSet]
        ([VatId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_VatSubtotalPerVat'
CREATE INDEX [IX_FK_VatSubtotalPerVat]
ON [dbo].[SubtotalPerVats]
    ([VatId]);
GO

-- Creating foreign key on [ServiceTypeId] in table 'ServiceTypePrices'
ALTER TABLE [dbo].[ServiceTypePrices]
ADD CONSTRAINT [FK_ServiceTypeServiceTypePrice]
    FOREIGN KEY ([ServiceTypeId])
    REFERENCES [dbo].[ServiceTypes]
        ([ServiceTypeId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [ServiceTypePrices_ServiceTypeId], [ServiceTypePrices_SeasonId] in table 'ServiceTypePriceAgeDiscount'
ALTER TABLE [dbo].[ServiceTypePriceAgeDiscount]
ADD CONSTRAINT [FK_ServiceTypePriceAgeDiscount_ServiceTypePrice]
    FOREIGN KEY ([ServiceTypePrices_ServiceTypeId], [ServiceTypePrices_SeasonId])
    REFERENCES [dbo].[ServiceTypePrices]
        ([ServiceTypeId], [SeasonId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [AgeDiscounts_AgeDiscountId] in table 'ServiceTypePriceAgeDiscount'
ALTER TABLE [dbo].[ServiceTypePriceAgeDiscount]
ADD CONSTRAINT [FK_ServiceTypePriceAgeDiscount_AgeDiscount]
    FOREIGN KEY ([AgeDiscounts_AgeDiscountId])
    REFERENCES [dbo].[AgeDiscounts]
        ([AgeDiscountId])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_ServiceTypePriceAgeDiscount_AgeDiscount'
CREATE INDEX [IX_FK_ServiceTypePriceAgeDiscount_AgeDiscount]
ON [dbo].[ServiceTypePriceAgeDiscount]
    ([AgeDiscounts_AgeDiscountId]);
GO

-- --------------------------------------------------
-- Script has ended
-- --------------------------------------------------